[POC][DO_NOT_MERGE] feat: customer billing portal POC#58
Open
brobro10000 wants to merge 2 commits intomainfrom
Open
[POC][DO_NOT_MERGE] feat: customer billing portal POC#58brobro10000 wants to merge 2 commits intomainfrom
brobro10000 wants to merge 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a customer billing portal proof-of-concept by adding a "View Receipt" button to the purchase summary. The feature is currently stubbed and only enables the button when users have a valid Stripe customer ID.
- Added a new
ReceiptButtoncomponent with conditional enabling based on Stripe customer ID - Integrated the receipt button into the
PurchaseSummarycomponent's footer - Updated type definitions to ensure proper checkout intent data handling
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/components/app/routes/loaders/utils.ts | Updated type signature to require both checkout intent and success properties |
| src/components/PurchaseSummary/ReceiptButton.tsx | New component implementing the stub receipt button with conditional enabling |
| src/components/PurchaseSummary/PurchaseSummary.tsx | Added receipt button to the purchase summary card footer |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds functionality to allow users to view their purchase receipt by introducing a "View Receipt" button in the purchase summary. The implementation includes a new hook to create a billing portal session, supporting backend integration and query management. The most important changes are summarized below:
Screen.Recording.2025-10-01.at.1.09.55.AM.mov
UI Enhancements:
ReceiptButtoncomponent to thePurchaseSummarycard, providing users with a "View Receipt" button that links to their billing portal session if available. (src/components/PurchaseSummary/PurchaseSummary.tsx,src/components/PurchaseSummary/ReceiptButton.tsx) [1] [2] [3]Data Layer & API Integration:
useCreateBillingPortalSessionhook to handle fetching the billing portal session URL, integrating user context and backend query logic. (src/components/app/data/hooks/useCreateBillingPortalSession.tsx,src/components/app/data/hooks/index.ts) [1] [2]queryCreateBillingPortalSessionto the data queries, enabling requests to the backend for creating billing portal sessions. (src/components/app/data/queries/queries.ts)createBillingPortalSessionquery key and function in the query key factory for consistent query management. (src/components/app/data/queries/queryKeyFactory.ts) [1] [2]create-billing-portal.tsservice to handle authenticated API requests for creating billing portal sessions. (src/components/app/data/services/create-billing-portal.ts)Type Improvements:
determineExistingCheckoutIntentStateto ensure correct intent typing. (src/components/app/routes/loaders/utils.ts)This PR requires the create portal session endpoint to be updated.
openedx/enterprise-access#860